/**
 * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.triumphsys.icici.cmeeting.portlet.model.impl;

import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.model.impl.BaseModelImpl;
import com.liferay.portal.service.ServiceContext;

import com.liferay.portlet.expando.model.ExpandoBridge;
import com.liferay.portlet.expando.util.ExpandoBridgeFactoryUtil;

import com.triumphsys.icici.cmeeting.portlet.model.CMOthersProposal;
import com.triumphsys.icici.cmeeting.portlet.model.CMOthersProposalModel;

import java.io.Serializable;

import java.lang.reflect.Proxy;

import java.sql.Types;

import java.util.Date;

/**
 * The base model implementation for the CMOthersProposal service. Represents a row in the &quot;CM_OTHERS_PROPOSAL&quot; database table, with each column mapped to a property of this class.
 *
 * <p>
 * This implementation and its corresponding interface {@link com.triumphsys.icici.cmeeting.portlet.model.CMOthersProposalModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link CMOthersProposalImpl}.
 * </p>
 *
 * <p>
 * Never modify or reference this class directly. All methods that expect a c m others proposal model instance should use the {@link com.triumphsys.icici.cmeeting.portlet.model.CMOthersProposal} interface instead.
 * </p>
 *
 * @author Triumphsys
 * @see CMOthersProposalImpl
 * @see com.triumphsys.icici.cmeeting.portlet.model.CMOthersProposal
 * @see com.triumphsys.icici.cmeeting.portlet.model.CMOthersProposalModel
 * @generated
 */
public class CMOthersProposalModelImpl extends BaseModelImpl<CMOthersProposal>
	implements CMOthersProposalModel {
	public static final String TABLE_NAME = "CM_OTHERS_PROPOSAL";
	public static final Object[][] TABLE_COLUMNS = {
			{ "othersProposalId", new Integer(Types.BIGINT) },
			{ "codCcmDt", new Integer(Types.TIMESTAMP) },
			{ "branchId", new Integer(Types.BIGINT) },
			{ "approvalTl", new Integer(Types.VARCHAR) },
			{ "proposal", new Integer(Types.VARCHAR) },
			{ "loanAmt", new Integer(Types.BIGINT) },
			{ "proposalId", new Integer(Types.BIGINT) }
		};
	public static final String TABLE_SQL_CREATE = "create table CM_OTHERS_PROPOSAL (othersProposalId LONG not null primary key,codCcmDt DATE null,branchId LONG,approvalTl VARCHAR(75) null,proposal VARCHAR(75) null,loanAmt LONG,proposalId LONG)";
	public static final String TABLE_SQL_DROP = "drop table CM_OTHERS_PROPOSAL";
	public static final String ORDER_BY_JPQL = " ORDER BY cmOthersProposal.othersProposalId ASC";
	public static final String ORDER_BY_SQL = " ORDER BY CM_OTHERS_PROPOSAL.othersProposalId ASC";
	public static final String DATA_SOURCE = "liferayDataSource";
	public static final String SESSION_FACTORY = "liferaySessionFactory";
	public static final String TX_MANAGER = "liferayTransactionManager";
	public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
				"value.object.entity.cache.enabled.com.triumphsys.icici.cmeeting.portlet.model.CMOthersProposal"),
			true);
	public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
				"value.object.finder.cache.enabled.com.triumphsys.icici.cmeeting.portlet.model.CMOthersProposal"),
			true);
	public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.util.service.ServiceProps.get(
				"lock.expiration.time.com.triumphsys.icici.cmeeting.portlet.model.CMOthersProposal"));

	public CMOthersProposalModelImpl() {
	}

	public long getPrimaryKey() {
		return _othersProposalId;
	}

	public void setPrimaryKey(long pk) {
		setOthersProposalId(pk);
	}

	public Serializable getPrimaryKeyObj() {
		return new Long(_othersProposalId);
	}

	public long getOthersProposalId() {
		return _othersProposalId;
	}

	public void setOthersProposalId(long othersProposalId) {
		_othersProposalId = othersProposalId;
	}

	public Date getCodCcmDt() {
		return _codCcmDt;
	}

	public void setCodCcmDt(Date codCcmDt) {
		_codCcmDt = codCcmDt;
	}

	public long getBranchId() {
		return _branchId;
	}

	public void setBranchId(long branchId) {
		_branchId = branchId;
	}

	public String getApprovalTl() {
		if (_approvalTl == null) {
			return StringPool.BLANK;
		}
		else {
			return _approvalTl;
		}
	}

	public void setApprovalTl(String approvalTl) {
		_approvalTl = approvalTl;
	}

	public String getProposal() {
		if (_proposal == null) {
			return StringPool.BLANK;
		}
		else {
			return _proposal;
		}
	}

	public void setProposal(String proposal) {
		_proposal = proposal;
	}

	public long getLoanAmt() {
		return _loanAmt;
	}

	public void setLoanAmt(long loanAmt) {
		_loanAmt = loanAmt;
	}

	public long getProposalId() {
		return _proposalId;
	}

	public void setProposalId(long proposalId) {
		_proposalId = proposalId;
	}

	public CMOthersProposal toEscapedModel() {
		if (isEscapedModel()) {
			return (CMOthersProposal)this;
		}
		else {
			return (CMOthersProposal)Proxy.newProxyInstance(CMOthersProposal.class.getClassLoader(),
				new Class[] { CMOthersProposal.class },
				new AutoEscapeBeanHandler(this));
		}
	}

	public ExpandoBridge getExpandoBridge() {
		if (_expandoBridge == null) {
			_expandoBridge = ExpandoBridgeFactoryUtil.getExpandoBridge(0,
					CMOthersProposal.class.getName(), getPrimaryKey());
		}

		return _expandoBridge;
	}

	public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
		getExpandoBridge().setAttributes(serviceContext);
	}

	public Object clone() {
		CMOthersProposalImpl cmOthersProposalImpl = new CMOthersProposalImpl();

		cmOthersProposalImpl.setOthersProposalId(getOthersProposalId());

		cmOthersProposalImpl.setCodCcmDt(getCodCcmDt());

		cmOthersProposalImpl.setBranchId(getBranchId());

		cmOthersProposalImpl.setApprovalTl(getApprovalTl());

		cmOthersProposalImpl.setProposal(getProposal());

		cmOthersProposalImpl.setLoanAmt(getLoanAmt());

		cmOthersProposalImpl.setProposalId(getProposalId());

		return cmOthersProposalImpl;
	}

	public int compareTo(CMOthersProposal cmOthersProposal) {
		int value = 0;

		if (getOthersProposalId() < cmOthersProposal.getOthersProposalId()) {
			value = -1;
		}
		else if (getOthersProposalId() > cmOthersProposal.getOthersProposalId()) {
			value = 1;
		}
		else {
			value = 0;
		}

		if (value != 0) {
			return value;
		}

		return 0;
	}

	public boolean equals(Object obj) {
		if (obj == null) {
			return false;
		}

		CMOthersProposal cmOthersProposal = null;

		try {
			cmOthersProposal = (CMOthersProposal)obj;
		}
		catch (ClassCastException cce) {
			return false;
		}

		long pk = cmOthersProposal.getPrimaryKey();

		if (getPrimaryKey() == pk) {
			return true;
		}
		else {
			return false;
		}
	}

	public int hashCode() {
		return (int)getPrimaryKey();
	}

	public String toString() {
		StringBundler sb = new StringBundler(15);

		sb.append("{othersProposalId=");
		sb.append(getOthersProposalId());
		sb.append(", codCcmDt=");
		sb.append(getCodCcmDt());
		sb.append(", branchId=");
		sb.append(getBranchId());
		sb.append(", approvalTl=");
		sb.append(getApprovalTl());
		sb.append(", proposal=");
		sb.append(getProposal());
		sb.append(", loanAmt=");
		sb.append(getLoanAmt());
		sb.append(", proposalId=");
		sb.append(getProposalId());
		sb.append("}");

		return sb.toString();
	}

	public String toXmlString() {
		StringBundler sb = new StringBundler(25);

		sb.append("<model><model-name>");
		sb.append(
			"com.triumphsys.icici.cmeeting.portlet.model.CMOthersProposal");
		sb.append("</model-name>");

		sb.append(
			"<column><column-name>othersProposalId</column-name><column-value><![CDATA[");
		sb.append(getOthersProposalId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>codCcmDt</column-name><column-value><![CDATA[");
		sb.append(getCodCcmDt());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>branchId</column-name><column-value><![CDATA[");
		sb.append(getBranchId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>approvalTl</column-name><column-value><![CDATA[");
		sb.append(getApprovalTl());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>proposal</column-name><column-value><![CDATA[");
		sb.append(getProposal());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>loanAmt</column-name><column-value><![CDATA[");
		sb.append(getLoanAmt());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>proposalId</column-name><column-value><![CDATA[");
		sb.append(getProposalId());
		sb.append("]]></column-value></column>");

		sb.append("</model>");

		return sb.toString();
	}

	private long _othersProposalId;
	private Date _codCcmDt;
	private long _branchId;
	private String _approvalTl;
	private String _proposal;
	private long _loanAmt;
	private long _proposalId;
	private transient ExpandoBridge _expandoBridge;
}